//
//  SeatsListBottomView.m
//  BaseProject
//
//  Created by 王洋 on 2020/11/13.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "SeatsListBottomView.h"

@implementation SeatsListBottomView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.addControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (self.SeatsListBottomBlock) {
            self.SeatsListBottomBlock(SeatsListBottomActionType_add);
        }
    }];
    
    [self.previewControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (self.SeatsListBottomBlock) {
            self.SeatsListBottomBlock(SeatsListBottomActionType_preview);
        }
    }];
    
}

- (IBAction)handleAction:(id)sender {
    if (self.SeatsListBottomBlock) {
        self.SeatsListBottomBlock(SeatsListBottomActionType_handle);
    }
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.handleBtn pp_clipCorners:UIRectCornerAllCorners radius:self.handleBtn.frame.size.height/2];
    });
}

@end
